home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Source Code / Visual Basic Source Code.iso / vbsource / vbmail / vbmail.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-10-23  |  6.1 KB  |  221 lines

  1. VERSION 2.00
  2. Begin Form vbmail 
  3.    BackColor       =   &H00FFFF00&
  4.    Caption         =   "Mail Message Editor"
  5.    ClientHeight    =   3555
  6.    ClientLeft      =   960
  7.    ClientTop       =   810
  8.    ClientWidth     =   7650
  9.    Height          =   4245
  10.    Icon            =   VBMAIL.FRX:0000
  11.    Left            =   900
  12.    LinkMode        =   1  'Source
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    ScaleHeight     =   3555
  16.    ScaleWidth      =   7650
  17.    Top             =   180
  18.    Width           =   7770
  19.    Begin TextBox MsgText 
  20.       Height          =   1845
  21.       Left            =   255
  22.       MultiLine       =   -1  'True
  23.       ScrollBars      =   2  'Vertical
  24.       TabIndex        =   2
  25.       Top             =   1545
  26.       Width           =   7200
  27.    End
  28.    Begin TextBox Subject 
  29.       Height          =   285
  30.       Left            =   780
  31.       TabIndex        =   1
  32.       Top             =   1005
  33.       Width           =   4395
  34.    End
  35.    Begin CommandButton ID_DISCARD 
  36.       Caption         =   "Discard"
  37.       Height          =   420
  38.       Left            =   6720
  39.       TabIndex        =   4
  40.       Top             =   705
  41.       Width           =   735
  42.    End
  43.    Begin CommandButton ID_SEND 
  44.       Caption         =   "Send"
  45.       Height          =   420
  46.       Left            =   5790
  47.       TabIndex        =   3
  48.       Top             =   720
  49.       Width           =   720
  50.    End
  51.    Begin TextBox Addressee 
  52.       Height          =   285
  53.       Left            =   780
  54.       TabIndex        =   0
  55.       Top             =   660
  56.       Width           =   3240
  57.    End
  58.    Begin PictureBox Picture2 
  59.       BackColor       =   &H00FFFF00&
  60.       BorderStyle     =   0  'None
  61.       Height          =   495
  62.       Left            =   6810
  63.       Picture         =   VBMAIL.FRX:0302
  64.       ScaleHeight     =   495
  65.       ScaleWidth      =   495
  66.       TabIndex        =   7
  67.       Top             =   135
  68.       Width           =   495
  69.    End
  70.    Begin PictureBox Picture1 
  71.       BackColor       =   &H00FFFF00&
  72.       BorderStyle     =   0  'None
  73.       Height          =   495
  74.       Left            =   5940
  75.       Picture         =   VBMAIL.FRX:0604
  76.       ScaleHeight     =   495
  77.       ScaleWidth      =   495
  78.       TabIndex        =   8
  79.       Top             =   150
  80.       Width           =   495
  81.    End
  82.    Begin Label Label3 
  83.       BackColor       =   &H00FFFF00&
  84.       Caption         =   "Subj:"
  85.       Height          =   300
  86.       Left            =   195
  87.       TabIndex        =   6
  88.       Top             =   1035
  89.       Width           =   510
  90.    End
  91.    Begin Label Label2 
  92.       BackColor       =   &H00FFFF00&
  93.       Caption         =   "To:"
  94.       Height          =   255
  95.       Left            =   195
  96.       TabIndex        =   5
  97.       Top             =   720
  98.       Width           =   375
  99.    End
  100.    Begin Label From 
  101.       BackColor       =   &H00FFFF00&
  102.       Caption         =   "fffffffffffffffffffffffffffffffffffffffffffffffffffff"
  103.       Height          =   285
  104.       Left            =   795
  105.       TabIndex        =   12
  106.       Top             =   360
  107.       Width           =   3225
  108.    End
  109.    Begin Label Label4 
  110.       BackColor       =   &H00FFFF00&
  111.       Caption         =   "From:"
  112.       Height          =   285
  113.       Left            =   195
  114.       TabIndex        =   11
  115.       Top             =   345
  116.       Width           =   510
  117.    End
  118.    Begin Label MsgDate 
  119.       BackColor       =   &H00FFFF00&
  120.       Caption         =   "xx/xx/xx"
  121.       Height          =   225
  122.       Left            =   810
  123.       TabIndex        =   10
  124.       Top             =   75
  125.       Width           =   840
  126.    End
  127.    Begin Label Label1 
  128.       BackColor       =   &H00FFFF00&
  129.       Caption         =   "Date:"
  130.       Height          =   255
  131.       Left            =   210
  132.       TabIndex        =   9
  133.       Top             =   60
  134.       Width           =   495
  135.    End
  136.    Begin Menu ID_FILE 
  137.       Caption         =   "&File"
  138.       Begin Menu ID_OPEN 
  139.          Caption         =   "&Open..."
  140.       End
  141.       Begin Menu menuspace 
  142.          Caption         =   "-"
  143.       End
  144.       Begin Menu ID_EXIT 
  145.          Caption         =   "E&xit"
  146.       End
  147.    End
  148. Sub Form_Load ()
  149.     MsgText.Text = ""
  150.     Addressee.Text = ""
  151.     Subject.Text = ""
  152.     MsgDate.Caption = MakeDate(Date$)
  153.     From.Caption = MyUserName
  154. End Sub
  155. Sub Form_Unload (Cancel As Integer)
  156.     End
  157. End Sub
  158. Sub ID_DISCARD_Click ()
  159.     If MsgBox("Discard Message?", 4, "E-Mail") = 6 Then
  160.         Addressee.Text = ""
  161.         Subject.Text = ""
  162.         MsgText.Text = ""
  163.         Addressee.SetFocus
  164.     End If
  165. End Sub
  166. Sub ID_EXIT_Click ()
  167.     End
  168. End Sub
  169. Sub ID_OPEN_Click ()
  170.     LastWindow = 1
  171.     OpenWindow.Show
  172. End Sub
  173. Sub ID_SEND_Click ()
  174.     '
  175.     ' Search For a match on user name
  176.     '
  177.     i = 0
  178.     Do While i < AddrBook.UserName.ListCount
  179.         User$ = RTrim$(Left$(AddrBook.UserName.List(i), 20))
  180.         If LCase$(User$) = LCase$(Addressee.Text) Then
  181.             Exit Do
  182.         End If
  183.         i = i + 1
  184.     Loop
  185.     If i = AddrBook.UserName.ListCount Then
  186.         '
  187.         ' No match on user name, load the address book
  188.         '
  189.         LastWindow = 1
  190.         AddrBook.Show
  191.     Else
  192.         '
  193.         ' matching user, build a file name
  194.         '
  195.         AddrUserId = Mid$(AddrBook.UserName.List(i), 21) + "\"
  196.         f = 1
  197.         Do
  198.             fn$ = AddrUserId + "EMAIL" + Right$("000" + LTrim$(Str$(f)), 3) + ".MSG"
  199.             If Dir$(fn$) = "" Then
  200.                 Exit Do
  201.             End If
  202.             f = f + 1
  203.         Loop Until f = 1000
  204.         If f = 1000 Then
  205.             MsgBox Addressee.Text + "'s Mailbox is Full", 16, "Error"
  206.         Else
  207.             Open fn$ For Output Access Write As #1
  208.             Print #1, Date$
  209.             Print #1, MyUserId
  210.             Print #1, Subject.Text
  211.             Print #1, MsgText.Text
  212.             Close #1
  213.             MsgBox "Message Delivered", 0, "E-Mail"
  214.             Addressee.SetFocus
  215.         End If
  216.     End If
  217. End Sub
  218. Sub Label2_Click ()
  219.     Addressee.SetFocus
  220. End Sub
  221.